const Router = require('@koa/router')
const { ask, editQuestionByQuestionId, addTag, getQuestions, getByQuestionId, deleteQuestionByQuestionId } = require('../controller/question.controller')
const { verifyToken } = require('../middleware/user.middleware')
const router = new Router({ prefix: '/api/question' })

router.post('/ask', verifyToken, ask)
router.post('/edit', verifyToken, editQuestionByQuestionId)
router.get('/addTag', verifyToken, addTag)
router.get('/list', getQuestions)
router.get('/byQuestionId', getByQuestionId)
// admin
router.post('/delete', verifyToken, deleteQuestionByQuestionId)

module.exports = router